 /**
 * 静态数据源
 * 用于定义全局变量和全局函数
 * */
package riki.org.com.model
{
	import flash.events.EventDispatcher;
	
	import riki.org.com.date.DataBase;
	//import riki.org.com.date.ServerDate;
	
	[Bindable]
	public class ModelLocator extends EventDispatcher
	{	
		private static	var	chatModelLocator	:ModelLocator;
		
		public	var	isOnline					:Boolean	=	false;
		
		//public	var	sDate						:ServerDate;
		
		public	var	sDataBase					:DataBase;
		
		public	var	vObj						:ViewObject;
		
		//public	var	MainApp						:Application;
		//public	var	MainStage					:Stage;
		
		public static function getInstance():ModelLocator
		{
			if ( chatModelLocator == null )
			{
				chatModelLocator = new ModelLocator();
			}
			return chatModelLocator;
		}
		
		public function ModelLocator()
	   	{
	   		if ( ModelLocator.chatModelLocator != null )
	   		{
	   			throw new Error( "Only one ModelLocator instance should be instantiated" );	
	   		}
	   		else
	   		{
	   			InitDate();
	   		}
	   	}
	   	
	   	public function InitDate():void
	   	{
	   		vObj		=	new	ViewObject();
	   		//sDate		=	new	ServerDate();
	   		
	   		//sDate.ServerApplicationList.addItem({label:"用户管理模块"	,data:"userManager"});
	   		//sDate.ServerApplicationList.addItem({label:"邮件消息模块"	,data:"newAcsChat"});
	   		//sDate.ServerApplicationList.addItem({label:"俄罗斯方块"	,data:"RussianBox"});
	   		
	   		sDataBase	=	new	DataBase();
	   	}		   
	}
}